package com.jhon.yinji.lichuanvip.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.jhon.yinji.lichuanvip.R;

public class NumberedAdapter extends RecyclerView.Adapter<TextViewHolder> {
  private final String[] array;
  public NumberedAdapter(String[] array) {
    this.array=array;
  }

  @Override
  public TextViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item, parent, false);
    return new TextViewHolder(view);
  }

  @Override
  public void onBindViewHolder(final TextViewHolder holder, final int position) {
    holder.textView.setText(array[position]);
    holder.itemView.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {

      }
    });
  }

  @Override
  public int getItemCount() {
    return array.length;
  }
}